/*
Copyright (C) 2009-2010 Xanadu Development Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef MOB_H
#define MOB_H

#define MOB_SHOW		-1
#define MOB_SPAWN		-2
#define MOB_TRANSFORM	-3

class Map;
class Timer;

#include "LifeMapObject.h"
#include <math.h>
#include <hash_map>

using namespace stdext;

class Mob : public LifeMapObject {
public:
	Mob(Map* map) {
		control = 0;
		this->map = map;
		aggressive = 0;
		dropTimer = NULL;
	}
	void setMobId(int mobid){
		this->mobid = mobid;
	}
	int getMobId(){
		return mobid;
	}
	void setOriginalId(int mapid){
		this->mapid = mapid;
	}
	int getOriginalId(){
		return mapid;
	}
	void setStartFh(short fh){
		sfh = fh;
	}
	short getStartFh(){
		return sfh;
	}
	void setHp(int hp){
		this->hp = hp;
		if(this-> hp < 0)
			this->hp = 0;
	}
	int getHp(){
		return hp;
	}
	void setMp(int mp){
		this->mp = mp;
		if(this->mp < 0)
			this->mp = 0;
	}
	int getMaxMp();
	int getMaxHp();
	bool isBoss();
	int getMp(){
		return mp;
	}
	void setControl(Player* control, bool agrs = false, bool switchc = true);
	Player* getControl();
	Map* getMap(){
		return map;
	}
	void takeDamage(Player* player, int damage);
	void giveExp();
	void findControl(bool spawn);
	void setAggressive(char ag){
		aggressive = ag;
	}
	char getAggressive(){
		return aggressive;
	}
	int getKillerId();
	void setDropTimer(Timer* timer);
	Timer* getDropTimer();
private:
	char aggressive;
	short sfh;
	int mapid, mobid, hp, mp;
	Player* control;
	Map* map;
	hash_map<int, int> playersa;
	Timer* dropTimer;
};

#endif
